package array;

import java.util.Arrays;

public class leetCode628_maximumProduct {

    public int maximumProduct(int[] nums) {
        if(nums == null || nums.length < 3) return 0;
        int n = nums.length;
        Arrays.sort(nums);
        return Math.max(nums[0] * nums[1] * nums[n - 1],nums[n - 3] * nums[n - 2] * nums[n - 1]);


    }

}
